package com.car.configtion;

import org.springframework.context.annotation.Configuration;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */
public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000118661334";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCoMLpl2s18rfpc/EVzGx2Fn21F/s/1ZskZRo9ZTUvBkOBiWAOxyVr+aiVMbTw/ZpRRbj9dY83eRdD4TDFfEup5mTBn4n4X29Lg+Arp8VOtCFQIyvD/Exj6YYJTLv7pl0WNUt+P+AlLiHbCQA8agqfww6/bbzgpF92mhermeNgo+g6SF12kKOr8JxHqPx4ILnB7ua67PZqk3yr3QIO/eV6lJW8qdrxefXGiT7sSfzeTqP2zV0IBbaUUbi1ZxS5M23G+iIZHqpvfZoeS7gWw2ALF1lWjDeY5YIQRVHsYX0Z6N/6nGU5/2JJmvZ69bj7rXH5Jy/AYdmy1eGsi3zdBDkofAgMBAAECggEAYgA6rFzI/Uw2pPXN1dtH4XNa7b0jGZ/xr4ugvW0/piMvy73zMSXdon7hCt5fi6XO6H/v5g/ghhJySCvFXNudyorLXMzpoidRggql+VjH4/wFUzZFJKvRExu8H5IzsJKXUVinsbDaYau7X0aKRm05RB4SGy98Lt2cJorDq9VgRscx4wObFMFTRAExoWyihKvU+whHJOlqDxCRC6KNxwnomKC1OWPu2/OuuuLhumidGH44eK+0geJULSGVzw1NcAgJtReAuM0yrulXW+T/fWS095MlrxJVL+HHS2ik9Tdg8VjEtzS2r1KTU5AmdIPOniAjIqqcoRZT/8VwGnfaHLZqKQKBgQDr92OrBlc2zIvt+RUymg5dckBg6WhpH/KMfVbjrgmLduB1cXZIfcH+E4wmapsuygrBIIpAlj7ZieDoqjf/bkqkQXXf+pDpg5yOMxfXEo8pX465jEr7WTKJLiYX+kO2KmFai0uCu7fCnORRUAAR7kaQfIJ9W5IJ/zceMORraYDhbQKBgQC2eELN4O2+9PNwdKa9MsfLLehU/dOQiVMUeeAEEMS+vLKLUq4IqD+nS0/7Z2CWqRUK4pa//ek+AaQCF5TEwHt1maZj7lXTt1fi2sNGUFSy/3tqVNo0dmLn38GFV3obaXSvFvX5Dp6gDl2femhDFcAyxAfUM1KaYUtS29EpVIPuOwKBgFDweu+fLStO3nCyj+LblTHYjtyvM3Fb1Ab8t2FBwWRlUnj2gmw7Nt/ANMK4rqJOC4JTdxjQcJ6N/OfR+4NSgaf2DEjX2f0/d+QPAo5zf0fhz0M2LEIrRnpnqglvfuptfxdf0Hb3jQDkcCy0FFISOYI2M0xsrJthP7bLbo6pkdvBAoGAcRKtMy+DpKXehX2EJhJlxP65zpFMnXC7zyCHNX2+rgP5EGU3+51ndKAy/DPfov08UPaBPJB4DTivDazXP+WXnBSPC7YR8ZTYHXg7MkNteU7gh8/1ODV0rQP3xE2lGX+ME0RDQQdSPRUp5z3PhmLgK5VW1KTJN2m7Z6lYQChjaSkCgYA8B5xdO0B2/pl/iULH9Fyi1C1Ieo6ZKWZHZXDf3GNF8bk2iyU8PWKjhwmKyXWB7kP+IuxbLxqinuKiGIUnAW59oLE+BVIECJjWDI7bvJbqhv1j7litjVRfVS5T8LiW7K4g3oofe/fYnMVxvN0OrVdaaqhpxfqtS7NewNl1U6M9Vw==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkBOzSzMr6k4J7G+DIkfiRHP3kvb09Thfl/RLOKi3Ptop+hDRAmRH2hGK5AELAKIU1krEchXxkxydtNUkNoEEGZ0OdRjvndSE7CsGVOp3H7UYPc/KrxwmTAUkg/TsxP6zywOsj0Ml72JlFJhwTomixDiX/MSG9SXDRDPeekvEzfDhdtNRNbklxaK3O/z/tdU4lfynasVB53fKw+7WHA8m7lKjbjJG0FteK/281cBHioj36ea3LkWUv+VZgpyQsztmsZko5m72O34K1mR1+8foLJjTqs8wnqxz3JgNT8k9KvfJGXw41/siN6Z2TVRZeaj+MvyJfyKB3SShoQ/8FP0zBQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://8rf95p.natappfree.cc";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://8rf95p.natappfree.cc";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

